/** 
 * extras.h - Various GUI extensions for WoodPecker
 *
 * WoodPecker is the legal property of its developers, whose names are too numerous
 * to list here.  Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: extras.h 136 2008-05-03 06:27:18Z dubkat $
 */

#define PURPLE_PLUGIN
#define PURPLE_DISABLE_DEPRECIATED 1

#include "pecker.h"
//#include "roombrowse.h"

#include "conversation.h"
#include "debug.h"
#include "prefs.h"
#include "signals.h"
#include "util.h"
#include "version.h"
#include "buddyicon.h"

#include <prpl.h>
#include <gtkconv.h>
#include <gtkplugin.h>
#include <gtkutils.h>

#ifndef PECKER_EXTRAS_H
#define PECKER_EXTRAS_H

#define PECKER_EXTRAS_PLUGIN_ID "gtk-woodpecker-extras"

#define PECKER_STOCK_ALPHA "alpha"
#define PECKER_STOCK_ENTRY "entry"
#define PECKER_STOCK_PIC "pic"

// Messy.
#ifdef _WIN32
#include "win32/win32dep.h"
#else
#define DATADIR PURPLE_DATADIR
#endif

struct fetch_thumbnail_data
{
    const char *who;
    char *pic_data;
    gint pic_data_len;
    gboolean from_file;
};

struct paint_data
{
    char *tooltiptext;
    GdkPixbuf *pixbuf;
    char *name;
};

// Additional UI info for a conversation.
// We may be able to clean this up, some.
typedef struct _PeckerChatIcon
{

    PurpleConversation *conv;
    GtkWidget *icon_container_parent;
    GtkWidget *icon_container;
    GtkWidget *frame;
    GtkWidget *icon;
    GtkWidget *event;
    gboolean show_icon;

} PeckerChatIcon;


typedef enum
{
    TOOLTIP_CHAT,
    TOOLTIP_IM,
} PeckerTooltipType;

struct timeout_cb_data
{
    PeckerTooltipType type;
    GtkWidget *tv;
    PurpleAccount *account;
};


GdkPixbuf *lookup_cached_thumbnail(PurpleAccount * account, const char *fullname);
void get_icon_scale_size(GdkPixbuf * icon, PurpleBuddyIconSpec * spec, int *width, int *height);
void clean_popup_stuff(PurpleConversation * c);
void add_chat_icon_stuff(PurpleConversation * c);
void add_chat_popup_stuff(PurpleConversation * c);
void add_chat_sort_functions(PurpleConversation * c);
void add_im_popup_stuff(PurpleConversation * c);
void init_chat_icons(PurplePlugin * plugin);
void init_popups();
void init_roombrowse(PurplePlugin * plugin);


static struct StockIcon
{
    const char *name;
    const char *dir;
    const char *filename;

} const stock_icons[] = {
    {PECKER_STOCK_ALPHA, "pecker", "alpha.png"},
    {PECKER_STOCK_ENTRY, "pecker", "entry.png"},
    {PECKER_STOCK_PIC, "pecker", "pic.png"}
};

#endif // PECKER_EXTRAS_H
